      SUBROUTINE QUIKVIS5B1(T1,T50,VISTIMES,IDTARG,KTARGTYP,TARGPARM)
      IMPLICIT REAL*8 (A-H,O-Z)
C
C THIS ROUTINE IS PART OF THE QUIKVIS PROGRAM.  IT CONTROLS CALLS TO THE
C OUTPUT ROUTINES THAT GIVE THE GRID AND MAP OUTPUT FOR THE SURVEY
C OPTION.
C
C >>  FOR ALL DATES IN THE T1-TO-T50 SPAN, MINIMUM AVAILABILITY
C     DURATIONS PER ORBIT HAVE BEEN GATHERED FOR ALL TARGETS ON THE
C     GRID AND ALL RAAN'S AND DATES OF INTEREST.  GIVE THE RESULTS SO
C     FAR IN GRID AND/OR MAP FORMAT.
C
C VARIABLE      DIM       TYPE I/O DESCRIPTION
C --------      ---       ---- --- -----------
C
C T1             1         R*8  I  THE FIRST TIME IN THE SPAN. IN
C                                  SECONDS SINCE 1950.0
C
C T50            1         R*8  I  TIME TO WHICH THE VISTIMES ARRAY
C                                  IS REFERENCED. SECONDS SINCE 1/1/50.
C
C VISTIMES    MAXTARGS     R*8  I  THE DURATION PER ORBIT(ALL NODES
C                                  CONSIDERED) THAT A TARGET IS AVAIL.
C                                  MAX BE FOR A SINGLE TIME OR RANGE OF
C                                  TIMES.  SEE QUIKVIS5B FOR BETTER
C                                  DESCRIPTION.  IN SECONDS.
C
C IDTARG      MAXTARGS     I*4  I  DESCRIBED IN QUIKVIS(=MAIN) PROLOGUE.
C
C KTARGTYP    MAXTARGS     I*4  I  DESCRIBED IN QUIKVIS(=MAIN) PROLOGUE.
C
C TARGPARM NPARMS,MAXTARGS R*8  I  DESCRIBED IN QUIKVIS(=MAIN) PROLOGUE.
C
C***********************************************************************
C
C BY C PETRUZZO/GFSC/742.   2/86.
C       MODIFIED....
C
C***********************************************************************
C
      INCLUDE 'QUIKVIS.INC'
C
      INTEGER*4 IDTARG(MAXTARGS)
      REAL*8 TARGPARM(NPARMS,MAXTARGS)
      INTEGER*4 KTARGTYP(MAXTARGS)
      REAL*8 VISTIMES(MAXTARGS)
C
      CHARACTER*20 CH1,CH2
      CHARACTER*2 CHTIMES(NRASURVEY),I4CHAR
      LOGICAL GRIDNOW,DOGRID,DOMAP
C
      IBUG = 0
      LUBUG = 19
C
      IF(IBUG.NE.0) WRITE(LUBUG,9001)
     *   (ITARG,TARGPARM(1,ITARG)*DEGRAD,TARGPARM(2,ITARG)*DEGRAD,
     *      VISTIMES(ITARG),ITARG=1,80)
 9001 FORMAT(/,' QUIKVIS5B1 DEBUG. ENTRY VALUES. FIRST 80.'/,
     *       (' ITARG=',I3,'  RA,DEC=',2G13.5,' VIS(SEC)=',G13.5))
C
C
C
C    KSVYOUT2 ASSIGNMENTS: (1=GRID ONLY, 2=MAP ONLY, ELSE=BOTH)
      DOGRID = KSVYOUT2.NE.2
      DOMAP =  KSVYOUT2.NE.1
C
C
C *************************
C *  PRINT THE TIME GRID  *
C *************************
C
      IF(DOGRID) CALL QUIKVIS5B1A(T1,T50,VISTIMES,TARGPARM)
C
C
C ******************************************
C *  GENERATE THE PRINTER PLOT OF THE SKY  *
C ******************************************
C
      IF(DOMAP) CALL QUIKVIS5B1B(T1,T50,VISTIMES,TARGPARM)
C
      RETURN
C
C***********************************************************************
C
C
C**** INITIALIZATION CALL. PUT GLOBAL PARAMETER VALUES INTO THIS
C     ROUTINE'S LOCAL VARIABLES.
C
      ENTRY QVINIT5B1
C
      CALL QUIKVIS999(-1,R8DATA,I4DATA,L4DATA)
      RETURN
C
C***********************************************************************
C
      END
